projects
/
gpsbabel.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ba64add
)
Add rtrim to trim those scanf'ed things with all the trailing whitespace.
author
robertl
<robertl>
Thu, 14 Nov 2002 05:16:05 +0000
(
05:16
+0000)
committer
robertl
<robertl>
Thu, 14 Nov 2002 05:16:05 +0000
(
05:16
+0000)
csv_stringtrim isn't quite what we need...
gpsutil.c
patch
|
blob
|
history
util.c
patch
|
blob
|
history
diff --git
a/gpsutil.c
b/gpsutil.c
index 6d0dc3e28f8203c2bc4a493cb14ccf0c0ccf6184..42fb4dbb9ed261bc0906d916665c63c98aff7920 100644
(file)
--- a/
gpsutil.c
+++ b/
gpsutil.c
@@
-55,6
+55,7
@@
data_read(void)
while( fscanf(file_in, "%s %le%c %le%c %ld%c %30[^,] %c",
name, &lat, &latdir, &lon, &londir,
&alt, &alttype, desc, icon) > 0) {
+ rtrim(desc);
wpt_tmp = xcalloc(sizeof(*wpt_tmp),1);
wpt_tmp->position.altitude.altitude_meters = alt;
wpt_tmp->shortname = xstrdup(name);
diff --git
a/util.c
b/util.c
index 190920290e8e3604582ca50def37728802f1dcfd..2a581c74fc6957d7301e9c3de7280995a12d6488 100644
(file)
--- a/
util.c
+++ b/
util.c
@@
-59,6
+59,23
@@
xstrdup(const char *s)
return o;
}
+void *
+rtrim(char *s)
+{
+ char *p;
+
+ while (*s) {
+ s++;
+ }
+
+ s--;
+ while (isspace (*s)) {
+ *s = 0;
+ s--;
+ }
+
+}
+
coord
mkposn(const char *string)